﻿//************************************************************ 
// Copyright © 2009 - 2010 Oleg Stuhin & Rostislav Haitovich
// To learn more about Mytrip.Mvc.Entyty visit 
// http://starterkitmytripmvc.codeplex.com/
// mytripmvc@gmail.com
// license: Microsoft Public License (Ms-PL) 
// ***********************************************************
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Mytrip.Theme
{
    /// <summary>
    /// PrimaryLayoutElements
    /// </summary>
    public static class PrimaryLayoutElements
    {
        /// <summary>
        /// width: 90%;
        /// margin-left: auto;
        /// margin-right: auto;
        /// </summary>
        /// <returns>static string</returns>
        public static string page()
        {
            StringBuilder result = new StringBuilder();
            result.AppendLine("width: 90%;");
            result.AppendLine("margin-left: auto;");
            result.AppendLine("margin-right: auto;");
            return result.ToString();
        }
        /// <summary>
        /// margin-bottom: 0px;
        /// color: #000;
        /// padding: 0;
        /// height: 93px;
        /// </summary>
        /// <returns>static string</returns>
        public static string header()
        {
            StringBuilder result = new StringBuilder();
            result.AppendLine("margin-bottom: 0px;");
            result.AppendLine("color: #000;");
            result.AppendLine("padding: 0;");
            result.AppendLine("height: 93px;");
            return result.ToString();
        }
        /// <summary>
        /// (blue)line-height: 2em;
        /// (blue)font-family: Arial, Helvetica, sans-serif;
        /// (blue)font-size: 32px !important;
        /// (green)line-height: 3.2em;
        /// (green)font-family: Georgia, 'Times New Roman', Times, serif;
        /// (green)font-size: 26px !important;
        /// color: #fff;
        /// font-weight: bold;
        /// padding: 0;
        /// margin: 0;
        /// </summary>
        /// <returns>static string</returns>
        public static string header_h1()
        {
            StringBuilder result = new StringBuilder();
            if (ThemeSetting.theme() == "blue")
            {
                result.AppendLine("line-height: 2em;");
                result.AppendLine("font-family: Arial, Helvetica, sans-serif;");
                result.AppendLine("font-size: 32px !important;");
            } if (ThemeSetting.theme() == "green")
            {
                result.AppendLine("line-height: 3.2em;");
                result.AppendLine("font-family: Georgia, 'Times New Roman', Times, serif;");
                result.AppendLine("font-size: 26px !important;");
            }
            if (ThemeSetting.theme() == "gray")
            {
                result.AppendLine("line-height: 2em;");
                result.AppendLine("font-size: 32px !important;");
                result.AppendLine("font-family: 'Trebuchet MS', Arial, Helvetica, sans-serif;");
            }
            result.AppendLine("color: #fff;");
            result.AppendLine("font-weight: bold;");
            result.AppendLine("padding: 0;");
            result.AppendLine("margin: 0;");
            return result.ToString();
        }
        /// <summary>
        /// (blue)margin-left: -2px;
        /// (blue, Firefox, IE6-7)top: -1px;
        /// (blue)top:0px;
        /// (green)background:url(green/background_title.png) repeat-x;
        /// (green)padding: 0 10px 0 10px;
        /// (green)top:0px;
        /// position:absolute;
        /// float: left;
        /// height:93px;
        /// </summary>
        /// <returns>static string</returns>
        public static string div_title()
        {
            StringBuilder result = new StringBuilder();
            if (ThemeSetting.theme() == "blue")
            {
                result.AppendLine("margin-left: -2px;");
                if (ThemeSetting.brouser == "Firefox" | ThemeSetting.brouser == "IE" && ThemeSetting.majorversion < 8)
                {
                    result.AppendLine("top: -1px;"); 
                }
                else
                {
                    result.AppendLine("top:0px;");
                }
            } 
            if (ThemeSetting.theme() == "green")
            {
                result.AppendLine("background:url(green/background_title.png) repeat-x;");
                result.AppendLine("padding: 0 10px 0 10px;");
                result.AppendLine("top:0px;");
            }
            result.AppendLine("position:absolute;");            
            result.AppendLine("float: left;");
            result.AppendLine("height:93px;");
            return result.ToString();
        }
        /// <summary>
        /// (blue)border: 5px #fff solid;
        /// (green)border: 5px #EDEBD5 solid;
        /// padding: 5px 5px 5px 5px;
        /// background-color: #fff;
        /// margin-bottom: 30px;
        /// _height: 1px;
        /// </summary>
        /// <returns>static string</returns>
        public static string main()
        {
            StringBuilder result = new StringBuilder();
            if (ThemeSetting.theme() == "blue")
            {
                result.AppendLine("border: 5px #fff solid;");
            }
            if (ThemeSetting.theme() == "gray")
            {
                result.AppendLine("border: 5px #ccc solid;");
                //result.AppendLine("border-top: 5px #ccc solid;");
            }
            if (ThemeSetting.theme() == "green")
            {
                result.AppendLine("border: 5px #EDEBD5 solid;");
            }
            result.AppendLine("padding: 5px 5px 5px 5px;");
            result.AppendLine("background-color: #fff;");
            result.AppendLine("margin-bottom: 30px;");
            result.AppendLine("_height: 1px;");
            return result.ToString();
        }
        /// <summary>
        /// color: #999;
        /// padding: 10px 0;
        /// text-align: center;
        /// line-height: normal;
        /// margin: 0;
        /// font-size: .9em;
        /// </summary>
        /// <returns>static string</returns>
        public static string foter()
        {
            StringBuilder result = new StringBuilder();
            result.AppendLine("color: #999;");
            result.AppendLine("padding: 10px 0;");
            result.AppendLine("text-align: center;");
            result.AppendLine("line-height: normal;");
            result.AppendLine("margin: 0;");
            result.AppendLine("font-size: .9em;");
            return result.ToString();
        }
    }
}
